package com.jeesite.modules.kj.api.vo.request;

import com.jeesite.common.entity.Page;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.modules.kj.entity.KjActivity;
import com.jeesite.modules.kj.entity.KjCity;
import com.jeesite.modules.kj.entity.KjContributeProject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
public class ProjectListRequestVo {


    @ApiModelProperty(name="projectType", value ="项目类型Id", example = "1")
    String projectType;

    @ApiModelProperty(name="pageNo", value ="页码，默认是1", example = "1")
    int pageNo;

    @ApiModelProperty(name="pageSize", value ="每页记录数，默认是10", example = "15")
    int pageSize;



    @ApiModelProperty(name="activityName", value ="活动名", example = "爱心活动")
    String activityName;

    public KjContributeProject convertToEntity(){
        KjContributeProject where = new KjContributeProject();
        if(StringUtils.isNotBlank(projectType)){
            where.setProjectType(projectType);
        }
        if(StringUtils.isNotBlank(activityName)){
            where.setName(activityName);
        }
        Page page = new Page(pageNo, pageSize);
        where.setPage(page);
        return where;
    }
}
